﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SDCloudSolution.SDCloud.Entities.Models
{
    /// <summary>
    ///     Represents a model run queued entity.
    /// </summary>
    [Table("model_run")]
    public class ModelRunEntity
    {
        /// <summary>
        /// Identifier of the model run.
        /// </summary>
        [Key]
        [Column("Id")]
        public int Id { get; set; }

        /// <summary>
        /// The model identifier.
        /// </summary>
        [Column("ModelId")]
        public int ModelId { get; set; }

        /// <summary>
        /// Date when this model execution was queued.
        /// </summary>
        [Column("QueuedDateUtc")]
        public DateTime QueuedDateUtc { get; set; }

        /// <summary>
        /// Date when this model execution was started in specified job-service.
        /// </summary>
        [Column("StartDateUtc")]
        public DateTime? StartDateUtc { get; set; }

        /// <summary>
        /// Date when this model execution was completed or canceled.
        /// </summary>
        [Column("EndDateUtc")]
        public DateTime? EndDateUtc { get; set; }

        /// <summary>
        /// The status of current model run.
        /// </summary>
        [Column("Status")]
        public ModelRunStatus Status { get; set; }

        /// <summary>
        /// The priority of this model run.
        /// </summary>
        [Column("Priority")]
        public ModelRunPriority Priority { get; set; }
    }
}
